<template>
	<view style="height: 100%;">
		<view class="type-title">
			{{ title }}
		</view>
		<view class="answer-content">
			<rich-text :nodes="nodes"></rich-text>
		</view>
		<view class="bottom">
			<view class="content">
				如果以上内容无法解决您的问题可以咨询客服
			</view>
			<!-- <view class="service-btn">
				客服咨询
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: '',
				mh: 0,
				nodes: [],
				title: "",
			}
		},
		onLoad(options) {
			this.type = JSON.parse(options.type)
			this.mh = uni.getSystemInfoSync().windowHeight
			this.getList()
		},
		methods: {
			getList() {
				uni.$http.get(`/Wechat/Help/getCommonProblemById?id=${ this.type.id }`)
					.then(res => {
						const data = res.data.data;
						this.title = data.article_title
						this.nodes = data.content
					})
			}
		},
		onShareAppMessage() {
			const type = JSON.stringify({
				id: this.type.id
			})
			return {
				title: '挺想租 | 租好物分享新生活',
				path: this.$mp.page.route + "?type=" + type,
			}
		},
	}
</script>

<style>
	page {
		background-color: #fff;
	}
</style>
<style scoped>
	.answer-content {
		text-indent: 2rem;
		margin-top: 3vh;
		color: #9c9c9c;
		font-size: 25rpx;
		padding: 10rpx;
	}

	.content {
		text-align: center;
		color: #cfcfcf;
		font-size: 25rpx;
	}

	.type-title {
		font-weight: bold;
		padding: 40rpx 20rpx 20rpx 20rpx;
	}

	.bottom {
		margin: 0 auto;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		padding: 0 0 3vh 0;
	}

	.service-btn {
		margin-top: 1vh;
		border: 1rpx solid red;
		border-radius: 50rpx;
		width: 280rpx;
		color: red;
		padding: 10rpx;
		text-align: center;
		font-size: 32rpx;
		box-sizing: border-box;
	}
</style>
